package com.industrial.operation.controller;

import cn.hutool.core.util.ArrayUtil;
import com.industrial.common.core.utils.poi.ExcelUtil;
import com.industrial.common.core.web.controller.BaseController;
import com.industrial.common.core.web.domain.AjaxResult;
import com.industrial.common.core.web.page.TableDataInfo;
import com.industrial.common.log.annotation.Log;
import com.industrial.common.log.enums.BusinessType;
import com.industrial.common.security.annotation.RequiresPermissions;
import com.industrial.common.security.utils.SecurityUtils;
import com.industrial.operation.domain.gxhzb.ChartsParams;
import com.industrial.operation.domain.gxhzb.OperationIndexManager;
import com.industrial.operation.domain.gxhzb.OperationKfqInfo;
import com.industrial.operation.service.IOperationKfqInfoService;
import com.industrial.system.api.domain.SysUser;
import com.industrial.system.api.model.LoginUser;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 工业运行评价-开发区信息Controller
 *
 * @author SangGuangCan
 * @date 2024-02-20
 */
@RestController
@RequestMapping("/developArea")
public class KfqImportInfoController extends BaseController
{
    @Autowired
    private IOperationKfqInfoService operationKfqInfoService;



    /**
     * <p>
     *     导入分数
     * </p>
     * @param file
     * @param years
     * @return
     */
    @PostMapping("/importScore")
    public AjaxResult importScore(@RequestPart("file") MultipartFile file,@RequestParam("years") String years){
        operationKfqInfoService.importExcelTemplateScore(file,years);
        return AjaxResult.success();
    }

    /**
     * <p>
     *     导入值
     * </p>
     * @param file
     * @param years
     * @return
     */
    @PostMapping("/importValue")
    public AjaxResult importValue(@RequestPart("file") MultipartFile file,@RequestParam("years") String years){
        operationKfqInfoService.importExcelTemplateValue(file,years);
        return AjaxResult.success();
    }


}
